package rdb

import "github.com/lishimeng/app-starter"

type DocInfoState int

const (
	DocInfoStateInit   DocInfoState = 1
	DocInfoStateSave   DocInfoState = 2
	DocInfoStateDelete DocInfoState = 3
)

type DocInfo struct {
	app.Pk
	Code     string `orm:"column(code);unique"`
	Digest   string `orm:"column(digest)"`
	Bucket   string `orm:"column(bucket)"`
	FilePath string `orm:"column(file_path)"`
	FileSize int64  `orm:"column(file_size)"`
	Name     string `orm:"column(name)"`
	Ext      string `orm:"column(ext)"`
	app.TableChangeInfo
}

type BucketAuth int

const (
	BucketPublic  BucketAuth = 1
	BucketPrivate BucketAuth = 2
)

// BucketInfo 存储分区
type BucketInfo struct {
	app.Pk
	Code     string     `orm:"column(code);unique"`
	Name     string     `orm:"column(name)"`
	Auth     BucketAuth `orm:"column(auth)"`
	RootPath string     `orm:"column(root_path)"`
}
